<?xml version="1.0" ?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
	version="1.0">
	<xsl:template match="/canss">
		<html>
			<body>
				<h2>Module List</h2>
				<ol>
					<table class="datatable">
						<tbody>
							<th scope='col'>
								<center>No</center>
							</th>
							<th scope='col'>
								<center>Module ID</center>
							</th>
							<th scope='col'>
								<center>Module Name</center>
							</th>
							<th scope='col'>
								<center>Manager</center>
							</th>
							<th scope='col'>
								<center>Commands</center>
							</th>
							<th scope='col'>
								<center>Net Address</center>
							</th>
							<th scope='col'>
								<center>Status</center>
							</th>
							<th scope='col'>
								<center>Log</center>
							</th>
							<th scope='col'>
								<center>Management</center>
							</th>
							
							<xsl:for-each select="canssModule_module">
								<tr>
									<td scope='col'>
										<center><xsl:number format="1"/></center>
									</td>
									<td>
										<xsl:value-of select="canssModule_mid"/><br/>
									</td>
									<td>
										<xsl:value-of select="canssModule_name"/><br/>
									</td>
									<td>
										<xsl:value-of select="canssPerson_name"/><br/>
									</td>
									<td class="singleentry">
										<xsl:if test="true()=canssModule_commands/canssModule_command/text()">
											<xsl:variable name="v_mid" select="canssModule_mid" />
											<xsl:for-each select="canssModule_commands/canssModule_command">
												<xsl:variable name="v_command" select="text()" />
												<form id='frm_{$v_mid}{$v_command}' action='svtAjaxModuleStatusUpdate' method='post'>
													<span style='cursor:pointer' 
														onclick="document.getElementById('frm_{$v_mid}{$v_command}').submit()"
														onmouseover="this.style.color='red'" onmouseout="this.style.color=''"
													>
														<xsl:value-of select="text()"/>
													</span>
													<input type='hidden' name='_command_mid' value='{$v_mid}' />
													<input type='hidden' name='_command' value='{$v_command}' />
													<input type='hidden' name='_rurl' value='mainframe.jsp?_pagenum=22' />
												</form>
											</xsl:for-each>
										</xsl:if>
										<xsl:if test="true()!=canssModule_commands/canssModule_command/text()">
											-
										</xsl:if>
									</td>
									<td>
										<xsl:value-of select="canssModule_netaddr"/><br/>
									</td>
									<td>
										<xsl:variable name="v_mid" select="canssModule_mid" />
										<xsl:variable name="v_js" select="canssModule_status_2_js" />
										<div id='div_canssModule_status_2_{$v_mid}' style="cursor:pointer"
											onclick="{$v_js}"
											onmouseover="this.style.color='red';{$v_js}" onmouseout="this.style.color=''"
										>
											<xsl:value-of select="canssModule_status_2"/><br/>
										</div>
									</td>
									<td class="singleentry">
										<xsl:variable name="v_mid" select="canssModule_mid" />
										<form method="post" action="getEventLog.jsp" target="_blank">
											<input type="hidden" name="_mid" value="{$v_mid}"/>
											<input type="image" value="Log" src="design/img/detail.png" style="width:20px;height:20px;border: 0px;" onclick="#"/>
										</form>
									</td>
									<td class="singleentry">
										<xsl:variable name="v_mid" select="canssModule_mid" />
										<form method="post" action="svtAjaxAddModule">
											<input class="maxsize" type="submit" value="절체" onclick=""/>
											<input type="hidden" name="_mid" value="{$v_mid}"/>
											<input type="hidden" name="_rurl" value="mainframe.jsp?_pagenum=22"/>
											<input type="hidden" name="_method" value="remove"/>
										</form>
									</td>
								</tr>
							</xsl:for-each>
							<tr>
								<form method="post" action="svtAjaxAddModule">
									<td>-</td>
									<td><input type="text" name="_mid" style="width:50px;"/></td>
									<td><input type="text" name="_name" style="width:100px;"/></td>
									<td><input type="text" name="_pid" style="width:70px;"/></td>
									<td><input type="text" name="_commands" style="width:100px;"/></td>
									<td><input type="text" name="_netaddr" style="width:100px;"/></td>
									<td>-</td>
									<td colspan="2">
										<input class="maxsize" type="submit" value="추가" onclick=""/>
										<input type="hidden" name="_rurl" value="mainframe.jsp?_pagenum=22"/>
										<input type="hidden" name="_method" value="add"/>
									</td>
								</form>
							</tr>
						</tbody>
					</table>
				</ol>
			</body>
		</html>
	</xsl:template>
</xsl:stylesheet>